﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class UIManager : MonoBehaviour
{
    public static UIManager Instance;

    public Text Text_score;

    public Button Button_red;
    public Button Button_green;
    public Button Button_blue;

    void Awake()
    {
        Instance = this;
    }

    private void Start()
    {
        EventTriggerListener.Get(Button_red.gameObject, null).onClick = (GameObject go, object data) =>
        {
            Player.Instance.colorType = ColorType.red;
            ShuaiFunction.Refresh(Player.Instance.sp, Player.Instance.colorType);
        };
        EventTriggerListener.Get(Button_green.gameObject, null).onClick = (GameObject go, object data) =>
        {
            Player.Instance.colorType = ColorType.green;
            ShuaiFunction.Refresh(Player.Instance.sp, Player.Instance.colorType);
        };
        EventTriggerListener.Get(Button_blue.gameObject, null).onClick = (GameObject go, object data) =>
        {
            Player.Instance.colorType = ColorType.blue;
            ShuaiFunction.Refresh(Player.Instance.sp, Player.Instance.colorType);
        };
    }


}
